<%@ page contentType="text/html; charset=UTF-8" 
import="java.util.*,com.admin.User,com.admin.Role"

%>
 <% User user=(User)request.getSession().getAttribute("login_user");
    Role role=(Role)request.getSession().getAttribute("user_roles");
 %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html >    
    <head>
        <title>药品生产变更管理平台</title>
         <link rel="icon" href="<%=path%>/images/favicon.ico" type="image/ico">
         <link href="<%=path%>/css/bootstrap.min.css" rel="stylesheet">
         <link href="<%=path%>/css/materialdesignicons.min.css" rel="stylesheet">
          <link rel="stylesheet" href="<%=path%>/js/bootstrap-multitabs/multitabs.min.css">
         <link href="<%=path%>/css/style.min.css" rel="stylesheet">
         <link href="<%=path%>/css/animate.css" rel="stylesheet">
         
    </head>
    
  <div class="lyear-layout-web">
  <div class="lyear-layout-container">
    <!--左侧导航-->
    <aside class="lyear-layout-sidebar">
      
      <!-- logo -->
      <div id="logo" class="sidebar-header">
       <a href=""><img src="<%=path%>/images/logo-sidebar.png" title="LightYear" alt="LightYear" /></a>
      </div>
      <div class="lyear-layout-sidebar-scroll"> 
        
        <nav class="sidebar-main">
          <ul class="nav nav-drawer">
            <li class="nav-item active"> <a class="multitabs" href="<%=path%>/<%=role.getLoginpage()%>"><i class="mdi mdi-home"></i> <span>后台首页</span></a> </li>
              <s:if test="menus != null">
		 <s:iterator value="menus" var="topmenu">
         <li class="nav-item nav-item-has-subnav"> 
         <a href="javascript:void(0)"><i class="mdi <s:property value="#topmenu.SjIcons"/>"></i><span><s:property value="#topmenu.Sjmenuname"/></span></a>
           <ul class="nav nav-subnav" > 
            <s:if test="#topmenu.subMenus != null">
			 <s:iterator value="#topmenu.subMenus" var="menus">
              <li ><a class="multitabs"  href="<%=path%>/<s:property value="#menus.Menuurl"/>?menuid=<s:property value="#menus.Menuid"/>"> <i class="icon-chevron-right"></i><s:property value="#menus.Menuname"/></a>
                        </li>              
           </s:iterator>
		 </s:if> 
		  </ul>
          </li>
          </s:iterator>
		 </s:if> 
          </ul>
        </nav>
        
        <div class="sidebar-footer">
          <p class="copyright">Copyright &copy; 2021. <a target="_blank" href="https://www.huahaipharm.com">华海药业</a> All rights reserved.</p>
        </div>
      </div>
      
    </aside>
    <!--End 左侧导航-->
    
    <!--头部信息-->
    <header class="lyear-layout-header">
      
      <nav class="navbar navbar-default">
        <div class="topbar">
          
          <div class="topbar-left">
            <div class="lyear-aside-toggler">
              <span class="lyear-toggler-bar"></span>
              <span class="lyear-toggler-bar"></span>
              <span class="lyear-toggler-bar"></span>
            </div>
          </div>
          
          <ul class="topbar-right">
            <li class="dropdown dropdown-profile">
              <a href="javascript:void(0)" data-toggle="dropdown">
              <img style="width:35px; height: 35px;"  class="img-avatar img-avatar-58 m-r-10" src="<%=path%>/photo/<%=user.getUsername()%>.jpg" alt="<%=role.getRolename()%>">
                <span><%=user.getUsername()%><span class="caret"></span></span>
              </a>
              <ul class="dropdown-menu dropdown-menu-right">
                <li> <a class="multitabs" data-url="<%=path%>/admin/uppword" href="javascript:void(0)"><i class="mdi mdi-lock-outline"></i> 修改密码</a> </li>
                <li class="divider"></li>
                <li> <a href="<%=path%>/logout"><i class="mdi mdi-logout-variant"></i> 退出登录</a> </li>
              </ul>
            </li>
            <!--切换主题配色-->
		      <li class="dropdown dropdown-skin">
			  <span data-toggle="dropdown" class="icon-palette"><i class="mdi mdi-palette"></i></span>
			  <ul class="dropdown-menu dropdown-menu-right" data-stopPropagation="false">
              <li class="drop-title"><p>主题</p></li>
               <%--  <li class="drop-skin-li clearfix">
                  <span class="inverse">
                    <input type="radio" name="site_theme" value="default" id="site_theme_1" checked>
                    <label for="site_theme_1"></label>
                  </span>
                  <span>
                    <input type="radio" name="site_theme" value="dark" id="site_theme_2">
                    <label for="site_theme_2"></label>
                  </span>
                  <span>
                    <input type="radio" name="site_theme" value="translucent" id="site_theme_3">
                    <label for="site_theme_3"></label>
                  </span>
                </li> 
			    --%> <li class="drop-title"><p>LOGO</p></li>
				<li class="drop-skin-li clearfix">
                  <span class="inverse">
                    <input type="radio" name="logo_bg" value="default" id="logo_bg_1" checked>
                    <label for="logo_bg_1"></label>
                  </span>
                  <span>
                    <input type="radio" name="logo_bg" value="color_2" id="logo_bg_2">
                    <label for="logo_bg_2"></label>
                  </span>
                  <span>
                    <input type="radio" name="logo_bg" value="color_3" id="logo_bg_3">
                    <label for="logo_bg_3"></label>
                  </span>
                  <span>
                    <input type="radio" name="logo_bg" value="color_4" id="logo_bg_4">
                    <label for="logo_bg_4"></label>
                  </span>
                  <span>
                    <input type="radio" name="logo_bg" value="color_5" id="logo_bg_5">
                    <label for="logo_bg_5"></label>
                  </span>
                  <span>
                    <input type="radio" name="logo_bg" value="color_6" id="logo_bg_6">
                    <label for="logo_bg_6"></label>
                  </span>
                  <span>
                    <input type="radio" name="logo_bg" value="color_7" id="logo_bg_7">
                    <label for="logo_bg_7"></label>
                  </span>
                  <span>
                    <input type="radio" name="logo_bg" value="color_8" id="logo_bg_8" >
                    <label for="logo_bg_8"></label>
                  </span>
				</li>
				<li class="drop-title"><p>头部</p></li>
				<li class="drop-skin-li clearfix">
                  <span class="inverse">
                    <input type="radio" name="header_bg" value="default" id="header_bg_1" checked>
                    <label for="header_bg_1"></label>                      
                  </span>                                                    
                  <span>                                                     
                    <input type="radio" name="header_bg" value="color_2" id="header_bg_2">
                    <label for="header_bg_2"></label>                      
                  </span>                                                    
                  <span>                                                     
                    <input type="radio" name="header_bg" value="color_3" id="header_bg_3">
                    <label for="header_bg_3"></label>
                  </span>
                  <span>
                    <input type="radio" name="header_bg" value="color_4" id="header_bg_4">
                    <label for="header_bg_4"></label>                      
                  </span>                                                    
                  <span>                                                     
                    <input type="radio" name="header_bg" value="color_5" id="header_bg_5">
                    <label for="header_bg_5"></label>                      
                  </span>                                                    
                  <span>                                                     
                    <input type="radio" name="header_bg" value="color_6" id="header_bg_6">
                    <label for="header_bg_6"></label>                      
                  </span>                                                    
                  <span>                                                     
                    <input type="radio" name="header_bg" value="color_7" id="header_bg_7">
                    <label for="header_bg_7"></label>
                  </span>
                  <span>
                    <input type="radio" name="header_bg" value="color_8" id="header_bg_8" >
                    <label for="header_bg_8"></label>
                  </span>
				</li>
				<li class="drop-title"><p>侧边栏</p></li>
				<li class="drop-skin-li clearfix">
                  <span class="inverse">
                    <input type="radio" name="sidebar_bg" value="default" id="sidebar_bg_1" checked>
                    <label for="sidebar_bg_1"></label>
                  </span>
                  <span>
                    <input type="radio" name="sidebar_bg" value="color_2" id="sidebar_bg_2">
                    <label for="sidebar_bg_2"></label>
                  </span>
                  <span>
                    <input type="radio" name="sidebar_bg" value="color_3" id="sidebar_bg_3">
                    <label for="sidebar_bg_3"></label>
                  </span>
                  <span>
                    <input type="radio" name="sidebar_bg" value="color_4" id="sidebar_bg_4">
                    <label for="sidebar_bg_4"></label>
                  </span>
                  <span>
                    <input type="radio" name="sidebar_bg" value="color_5" id="sidebar_bg_5">
                    <label for="sidebar_bg_5"></label>
                  </span>
                  <span>
                    <input type="radio" name="sidebar_bg" value="color_6" id="sidebar_bg_6">
                    <label for="sidebar_bg_6"></label>
                  </span>
                  <span>
                    <input type="radio" name="sidebar_bg" value="color_7" id="sidebar_bg_7">
                    <label for="sidebar_bg_7"></label>
                  </span>
                  <span>
                    <input type="radio" name="sidebar_bg" value="color_8" id="sidebar_bg_8" >
                    <label for="sidebar_bg_8"></label>
                  </span>
				</li>
			  </ul>
			</li>
               <!--切换主题配色-->
          </ul>
          
        </div>
      </nav>
      
    </header>
    <!--End 头部信息-->
    
    <!--页面主要内容-->
    <main class="lyear-layout-content">
      
      <div id="iframe-content"></div>
      
    </main>
    <!--End 页面主要内容-->
  </div>
</div>
<script type="text/javascript" src="<%=path%>/js/jquery.min.js"></script>

<script type="text/javascript" src="<%=path%>/js/bootstrap.min.js"></script>
<script type="text/javascript" src="<%=path%>/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="<%=path%>/js/index.min.js"></script>
<script type="text/javascript" src="<%=path%>/js/bootstrap-multitabs/multitabs.js"></script>
 
 
 <script type="text/javascript">
var mainpage="<%=role.getLoginpage()%>";
var userno="<s:property value="#session.login_user.Userid"/>";
var Comid="<s:property value="#session.user_companys.Comid"/>";
var success="0";
var layuiexturl='<%=path%>/style/layui/js/';
var txurl="ws://"+window.location.host+"<%=path%>/websocket/"+userno;
var tcurl="<%=path%>/logout?message=";
var logoinput=window.localStorage.getItem("logoinput");
var headerinput=window.localStorage.getItem("headerinput");
var sidebarinput=window.localStorage.getItem("sidebarinput");


if(logoinput!=null){
	var xz=$("#"+logoinput);
	
	$("input[name='logo_bg']").checked=false;
	xz[0].checked=true;
	$('body').attr("data-logobg", xz[0].value);
	
}

if(headerinput!=null){
	var xz=$("#"+headerinput);
	
	$("input[name='header_bg']").checked=false;
	xz[0].checked=true;
	$('body').attr("data-headerbg", xz[0].value);
	
}

if(sidebarinput!=null){
	var xz=$("#"+sidebarinput);
	
	$("input[name='sidebar_bg']").checked=false;
	xz[0].checked=true;
	$('body').attr("data-sidebarbg", xz[0].value);
	
}



// 选项卡
    $('#iframe-content').multitabs({
        iframe : true,
        nav: {
            backgroundColor: '#ffffff',
            maxTabs : 35, // 选项卡最大值
        },
        init : [{
            type : 'main',
            title : '首页',
            url : '<%=path%>/'+mainpage
        }]
    });
   
    function shauxing(){
    	location.reload();
    	
    }
    function tuichu(){
    	

    	location.href = "<%=path%>/logout";

    		
    	}

    setInterval(function() {
    	sfcs();
       }, 1801000); 

    function sfcs(){
      var online=true;
    	$.ajax({
    	        url: "<%=path%>/sfcs",
    	        data: '',
    	        type: "Post",
    	        success: function (result) {
                if(result=="0"){
    	    	   online=false;
                   tuichu();
                }
    	    	 return online;
    	      }
    		 }); 
   }
	
</script>


</body>
</html>